<extend name="Public:bg_theme" />

<block name="css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/uploadify/uploadify.css"/>
</block>
<block name="js">
    <script src="__PUBLIC__/js/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
</block>

<block name="content">
    <script type="text/javascript" src="__PUBLIC__/js/Validform_v5.3.2.js"></script>
    <div class="location">
        <i>当前位置：</i>
        <a href="javascript:;" class="nav_a">文章管理 - </a>
        <a href="{:U('index')}" class="nav_a">文章列表 - </a>
        <a href="{:U('')}" class="nav_a">编辑文章</a>
    </div>

    <form action="{:U('update')}" method="post" class="form-horizontal manage_table addform">
        <div class="form-item cf">
            <label class="item-label"><span class="must">*</span>标题<span class="check-tips Validform_checktip"></span></label>
            <div class="controls">
                <input type="text" value="{$record.title}" name="title" class="text input-large" datatype="*" errormsg="存在特殊字符" nullmsg="标题必须">
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">标识：<span class="Validform_checktip"></span></label>
            <div class="controls">
                <input type="text" name="name" class="input_style input_focus content_text" datatype="s" errormsg="存在特殊字符" nullmsg="标识必须" value="{$record.name}">
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">描述：<span class="check-tips"></span></label>
            <div class="controls">
                <label class="textarea input-large"><textarea name="description" id="description" cols="30" rows="0">{$record.description}</textarea></label>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">内容：<span class="check-tips"></span></label>
            <div class="controls">
                <label class="textarea"><textarea name="content" id="content" cols="30" rows="0">{$record.content}</textarea></label>
                {:hook('adminArticleEdit', array('name'=>'content','value'=>''))}
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">分类：<span class="check-tips"></span></label>
            <select name="cate_id">
                <option value="0">请选择</option>
                <volist name="nav_tree" id="cate">
                    <option value="{$cate.id}"<eq name="_GET.pid" value="$cate.id"> selected</eq>>{$cate.title_show}</option>
                </volist>
            </select>
        </div>
        <div class="form-item cf">
            <label class="item-label">外链：<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" name="link_id" class="input_style input_focus content_text" value="{$record.link_id|get_link}">
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">封面：<span class="check-tips"></span></label>
            <div class="controls">
                <include file="Public:upload" button_text="上传" file_type_desc="image files" file_type_exts="*.jpg;*.png;*.jpeg;*.gif" target="coverUpload" />
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">类型：<span class="check-tips"></span></label>
            <div class="controls">
                <select name="type" class="input_style input_focus content_select">
                    <option value="1">普通</option>
                    <option value="2">单页</option>
                </select>
            </div>
        </div>
        <div class="form-item cf">
            <label class="item-label">排序：<span class="check-tips"></span></label>
            <div class="controls">
                <input class="input_style input_focus content_text" type="text" name="sort" value="{$record.sort}">
            </div>
        </div>
        <input class="hidden" name="model" value="Article" />
        <input type="hidden" name="id" value="{$record.id}">
        <button type="submit" class="find_btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
        <button class="find_btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </form>

    <script type="text/javascript">
        $(function() {
            $(".addform").Validform({
                tiptype: 2
            });
            Think.setValue('cate_id', '{$record.cate_id|default=0}');
            Think.setValue('type', '{$record.type|default=0}');
        })
    </script>
</block>

<block name="foot_js">
    $(function(){
        //左侧导航子页面高亮选中
        highlight_sidebar('{:U('index')}');
    });
</block>
